<%--
  Author: lwx
  Date: 2021/05/08
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="utf-8">
    <title>登录页面</title>
    <%--设置网页的基础路径，只会往没有斜杠的路径前面添加--%>
    <%--<base href="http://localhost:8080/stuinfomanagesys/">--%>
    <%--动态获取bese--%>
    <base href="${pageContext.request.scheme}://${pageContext.request.serverName}:${pageContext.request.serverPort}${pageContext.request.contextPath}/">
    <link rel="stylesheet" href="css/form.css">
</head>
<body>
<form action="login" onsubmit="return checkForm();" method="post">
    <div class="from">
        <div class="submit">
            <span class="form_title">登录</span>
            <div class="form_input">
                <span>用户名 :</span>
                <input class="inputs" id="username" type="text" name="username" placeholder="输入用户名">
            </div>
            <div class="form_input">
                <span>密码 :</span>
                <input class="inputs" id="password" type="password" name="password" placeholder="输入密码">
            </div>
            <div>
                <input name="agree" value="1" type="checkbox" class="noLogin">&nbsp;十天内免登录
            </div>
            <div class="btn_submit">
                <a>
                    <button class="btn" type="submit">登录</button>
                </a>
                <a href="index.jsp" class="back">
                    <button class="home_href" type="button">返回</button>
                </a>
            </div>
            <br><br><br>
            <%--<div class="tk" style="margin-left: 100px;">
            <input name="agree" type="checkbox" checked="checked">&nbsp;我已阅读并同意相关服务条款和隐私政策
            </div>--%>
            <div>
                <a id="register" href="register.jsp" class="input_li">没有账号？立即注册</a>
            </div>
        </div>
    </div>
</form>
</body>
<script type="text/javascript">
    function checkForm(){
        var uValue = document.getElementById("username").value;
        if(uValue==""){
            alert("用户名不能为空!");
            return false;
        }
        var pValue = document.getElementById("password").value;
        if(pValue==""){
            alert("密码不能为空!");
            return false;
        }
    }
</script>
</html>
